/*
 *说明：审批权限表 管理脚本
 *
 *@author mlc 2013-04-07
*/

var opeForm;

$(function() {
	
	opeForm = $('#opeForm');
	hitTree('0');
	$("#reloadBtn").click(refreshWin);
	
});

// 处理左侧树的点击事件
function hitTree(code, txt, deep, isleaf, attributes) {
	var url = "";	
	// 审批人
	
	//alert(code);
	var approve_by;
	if (code == '0') {
		approve_by = null;
		url = 'P_WF_APPROVE_AUTH!showInfo.do';
	}else{
		approve_by = attributes.usr_id;
		url = 'P_WF_APPROVE_AUTH!showInfo.do?model.approve_by=' + approve_by;
	}
	$('#mainFrame').attr('src', url);
}

function afterOK(operationType, data) {
	// 根据操作类型，调用添加节点或更新节点操作
	if (operationType  == '0') {
		treeFrame.createNode(data.role_code, data.role_code + ' ' + data.role_name, data);

	} else if (operationType == '1') {
		treeFrame.updateNode(data.role_code, data.role_code + ' ' + data.role_name, data);
	}
}